/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.os.dao.zakharov.oracledao;

import edu.os.dao.zakharov.DAOFactory;
import edu.os.dao.zakharov.interfacedao.*;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author Zakharov
 */
public class OracleDAOFactory extends DAOFactory {

    @Override
    public PaymentSystemDAO getPaymentSystemDAO() {
        return new OraclePaymentSystemDAO();
        //throw new UnsupportedOperationException("Not supported yet.");

    }

    @Override
    public RegistrationDAO getRegistrationDAO() {
        RegistrationDAO registrationDAO = null;
        try {
            InitialContext ic = new InitialContext();
            registrationDAO = (RegistrationDAO) ic.lookup(RegistrationDAO.class.getName());
        } catch (NamingException ex) {
            ex.printStackTrace();
        }
        return registrationDAO;
    }

    @Override
    public RequisitesDAO getRequisitesDAO() {
        return new OracleRequisitesDAO();
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public RoleUserDAO getRoleUserDAO() {
        return new OracleRoleUserDAO();
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public UsersDAO getUsersDAO() {
        UsersDAO usersDAO = null;
        try {
            InitialContext ic = new InitialContext();
            usersDAO = (UsersDAO) ic.lookup(UsersDAO.class.getName());
        } catch (NamingException ex) {
            ex.printStackTrace();
        }
        return usersDAO;
    }

    @Override
    public UserPaymentSystemDAO getUserPaymentSystemDAO() {
        return new OracleUserPaymentSystemDAO();
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public UserRolesDAO getUserRolesDAO() {
        return new OracleUserRolesDAO();
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public ApplicationDAO getApplicationDAO() {
        return new OracleApplicationDAO();
        //throw new UnsupportedOperationException("Not supported yet.");
    }
}
